<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    <!--子函数,可以访问外层函数的变量-->

    let arr = [1, 2, 3, 34, 4, 5, 6, 7, 8]

    function between(a, b) {
        return v => v >= a && v <= b;
    }

    let numbers = arr.filter(between(2, 10));
    console.log(numbers)
</script>
</body>
</html>
